package com.pharmacy.UserManage.dao;//package com.pharmacy.UserManage.dao;
//
//
//import com.pharmacy.UserManage.entity.OperationLog;
//import org.apache.ibatis.annotations.*;
//
//import java.util.Date;
//import java.util.List;
//
//@Mapper
//public interface OperationLogMapper {
//
//    // 获取所有操作日志
//    @Select("SELECT o.*, u.username " +
//            "FROM operation_log o " +
//            "JOIN user u ON o.userid = u.id " +
//            "ORDER BY o.operation_time DESC")
//    List<OperationLog> findAllLogs();
//
//    // 条件查询操作日志
//    @Select("<script>" +
//            "SELECT o.*, u.username " +
//            "FROM operation_log o " +
//            "JOIN user u ON o.userid = u.id " +
//            "WHERE 1=1 " +
//            "<if test='operationType != null'>AND o.operation_type = #{operationType}</if>" +
//            "<if test='targetType != null'>AND o.target_type = #{targetType}</if>" +
//            "<if test='startDate != null'>AND o.operation_time &gt;= #{startDate}</if>" +
//            "<if test='endDate != null'>AND o.operation_time &lt;= #{endDate}</if>" +
//            "ORDER BY o.operation_time DESC" +
//            "</script>")
//    List<OperationLog> findLogsByCondition(@Param("operationType") String operationType,
//                                           @Param("targetType") String targetType,
//                                           @Param("startDate") Date startDate,
//                                           @Param("endDate") Date endDate);
//
//    // 添加操作日志
//    @Insert("INSERT INTO operation_log(userid, operation_type, target_type, target_id, description) " +
//            "VALUES(#{userId}, #{operationType}, #{targetType}, #{targetId}, #{description})")
//    int addLog(OperationLog log);
//}
